home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: MegaDisc
/
MegaDisc 41 (1994-09)(MegaDisc Digital Publishing)(AU)(Disk 2 of 2).zip
/
MegaDisc 41 (1994-09)(MegaDisc Digital Publishing)(AU)(Disk 2 of 2).adf
/
ARexx_&_HBook
/
HyperText
/
DemoDoc.ht
(
.txt
)
< prev
next >
Wrap
HyperBook
|
1994-07-30
|
75KB
|
887 lines
,IXdK
D/* Mark chunk as used; go to reference */
j = Initiator() ; i = GetName(j)
p = SearchPageName('1:',i)
if p = '' then do ; call Inform('Reference not found') ; return ; end
call InterActive(0)
g = i || "2" ; k = SearchName(':',g)
o = SetShadow(k,5) ; o = SetBorder(k,5)
call InterActive(1)
old = CallPage(p)
return
z/* Reset all gadgets to unused state */
i = Initiator() ; c = GetBackGround(i) ; bg = SetBackGround(i,c+1)
call SearchStart('1:')
do forever
obj = SearchName('','2') ; if obj = '' then leave
b = GetShadow(obj)
if b = 5 then do
call InterActive(0)
o = SetBorder(obj,2) ; o = SetShadow(obj,2)
call Interactive(1)
end
end
bg = SetBackGround(i,c)
return
/* FrameSpec - for appending '.Box ' plus frame specs to a file */
top = GetClickRow('Click on the upper left corner of the frame')
left = GetColumn() ; bottom = GetClickRow('And on the bottom right corner')
right = GetColumn() ; w = right - left ; h = bottom - top
if w < 62 | h < 24 then fr= SearchName('0:','Small')
else fr = SearchName('0:','Large')
frame= Clone(fr,'0:')
call ScaleToSize(frame,w,h)
b = SetBorder(frame,2) ; s = SetShadow(frame,1)
call SetPosition(frame,left,top)
fr = Relocate(frame,':')
str = '.Bx ' || left || ',' || top || ',' || w || ',' || h || '0a'x
page = GetName(':') ; call SaveMoreText('ram:specs',page '0a'x str)
frame = ObjectToBack(fr)
FrameSpec
"Large"
"Large"
"AmigaGuide2"
"Navigation notes2"
"Quit"
call QuitHyperBook()
"Zero"
"PageNumber"
call HyperBookToBack()
/
Note3
From Text to HyperText
A Hyperbook Project If you're new
to Hyperbook,
By John Collett click here to see
July, 1994 Navigation notes
Documents arranged in a hypertext format are, by definition, easy to
find your way around in. Clicking on highlighted chunks of texts takes
you directly to related texts.
One such system is AmigaGuide, some of whose users appear enthusiastic,
but I have waited in vain for a really clear, step-by-step description of
how to set it up.
So I have constructed this plain but workable alternative, and am
now in the process of working out how to do two things at once :
Put it through its paces
Explain how to use it
It may not be as pretty, as versatile, as powerful, or as fast as
AmigaGuide, but I can at least get it to work.
"Head"
"Header"
ltdocs 1
"Navigation notes"
"AmigaGuide"
"PageNumber"
call HyperBookToBack()
"ltdocs 1"
"Large"
"Master12"
"HBReader2"
"Builder2"
"Hyperbook2"
Note2
To convert a plain text into a ready-to-use
hypertext, you need these four components :
The ARexx Hyperbook
program or
Builder HBReader
The single-page The document
Hyperbook unit to be
Master1 processed.
If a few simple formatting rules are observed in 'Document', then when
'Builder' is run, the output from the process will be a ready-to-use
hypertext file called 'Document.ht'. That file can then be used via
Hyperbook or HBReader.
"Head"
"Header"
ltdocs 2
"Hyperbook"
"Builder"
"HBReader"
"Master1"
"PageNumber"
call HyperBookToBack()
"ltdocs 2"
Note1
"Colours2"
"Macros2"
"Frames2"
"Running2"
"Compilation2"
"Preparation2"
Note2
The remainder of this discussion is arranged under the following
headings :
Preparation of the input file - one or two details of
formatting you need to bear in mind.
Compilation Run the Builder program, and sit back and watch.
It takes some time.
Let it finish.
Running the output as a hypertext document.
Frames and how to add them.
Macros built in to the program - what they do.
Colours - how they are set, and how to change them.
"Head"
"Header"
ltdocs 3
"Preparation"
"Compilation"
"Running"
"Frames"
"Macros"
"Colours"
"PageNumber"
call HyperBookToBack()
"Hook"
"ltdocs 3"
"Small"
"Small"
"HBReader2"
"Hyperbook2"
Note1
| | | | | | |
| | | | | | |
The standard Hyperbook navigation gadgets
| | | | | | |
| | | | | | |
1 Toggle between tiny and large control panel -
| | | | | |
2 Go to previous page ----
| | | | |
3 Go to next page ------
| | | |
4 Go to first page ---------
5 Go to last page -----------
| |
6 Go back to where you came from -------------- |
7 A 'table of contents' gadget ----------------
Notes
1 The panel stays tiny in HBReader.
2 to 5 The four arrow keys do similar jobs.
6 The 'Return' key has the same effect.
Up to 50 steps can be retraced.
7 Displays a list of page names in a window. Any item in that
list is itself clickable, to take you directly to that page -
a built-in fully-functional alternative to the standard
hypertext clickable chunks of text.
My additions to this set of tools are described on the next two pages.
"Head"
"Header"
Navigation notes 1
"Hyperbook"
"HBReader"
"PageNumber"
call HyperBookToBack()
Drawing8
"Navigation notes 1"
"Small"
"Small"
"hypertext2"
Note1
The Crux of HyperText Navigation
Of particular significance in hypertext is the use of highlighting
to indicate chunks of text which are clickable, and which take you to
a selected destination. You may have clicked on such a chunk to come
here to these navigation notes.
Two further gadgets appear only on Page 1 - always easy to get to.
1 A 'Q' gadget, which, unlike the menu equivalent, lets you quit
without having to confirm whether or not you want to save first.
2 A 'Z' gadget, which lets you reset to zero the flags which show
the items you have used so far.
"Head"
"Header"
Navigation notes 2
"hypertext"
"PageNumber"
call HyperBookToBack()
"Navigation notes 2"
"Small"
"Small"
"frames2"
Note1
Top corners - information AND gadgets
Upper left : "Where am I locally?"
Shows the title of the current section and how far you are into it.
The box holding this information is also an active gadget - click on
it if and when you want to add frames.
Upper right : "Where am I in general?"
An entry such as '25/60' means you are on page 25 of the unit as a
whole, and that there are 60 pages in all.
This box is also a gadget : use it to push Hyperbook to the back if
you want to get at a text editor, a CLI window, or anything else
running or runnable behind the Hyperbook screen.
If an enlarged 'Return' arrow appears at the top of the screen, as
it does here, you are on the last (or only) page of the section.
That large arrow is only a reminder. It it not itself active - no
point clicking on it.
"Head"
"Header"
Navigation notes 3
"frames"
"PageNumber"
call HyperBookToBack()
"Hook"
"Navigation notes 3"
Note1
For the purpose of this discussion, think of a document as
containing a main text followed by a set of notes.
A 'note' is what you see when you click on a highlighted
chunk of text, and can be of any length.
Within the document only two characters have special functions,
and it is going to be tricky talking about the first of them
without invoking its function.
"Head"
"Header"
Preparation 1
"PageNumber"
call HyperBookToBack()
"Preparation 1"
"Small"
Note1
Special character 1
ASCII character 96 : it looks like a grave accent (as on '
'), and
shares a key with the '~'. I cannot show it here without invoking its
effect so, for these notes, I'll use the backslash character \ instead.
This marks the word \hilighted\ as a target for highlighting.
This also marks the word \hilighted as a target for highlighting.
You need only mark the lefthand end to \highlight a single word -
the next space is read as the righthand delimiter. But if there is,
for example, punctuation which you wish to exclude, then both ends
need to be \marked\, as I have done here.
An end-of-line word with a single mark will be correctly \highlighted
even though there is no following space.
The \marked chunk\ may be more than one word in length, in which case
markers must be used \at both ends\.
Highlighted words will do their job anywhere - in the main text or in
notes. They will always take you directly to the related note,
assuming it exists. If it doesn't exist, you'll be told 'Reference
not found', and you'll stay where you are.
"Head"
"Header"
Preparation 2
"PageNumber"
call HyperBookToBack()
"Preparation 2"
"Small"
"Builder2"
Note1
Special character 2 is a full stop ( or a 'period' if you prefer).
A full stop alone on a line marks any of the following :
An end-of-screen break in the middle of the main text.
The end of the main text.
An end-of-screen break in the middle of a note.
The end of a note.
A full stop immediately followed by one or more words marks the
beginning of a note. The rest of the text on that line, following the
full stop, should be exactly the same as a highlighted chunk of text
elsewhere in the file. The one takes you to the other.
So at the end of the main text or at the end of a note (except the
last one) you must have
two consecutive lines
beginning with a full
stop, the first one on its own to mark an end, the next one followed by
a label to indicate the start of a note.
See the next screen, and/or comments in Builder.
"Head"
"Header"
Preparation 3
"Builder"
"PageNumber"
call HyperBookToBack()
"Preparation 3"
Note1
| Main text
| }
| . Page break } Repeated until end
| Main text } of main text
| }
|
| . End of main text
| .Note 1 Label for first note
| Note text }
| }
| } }
| . Page break } Repeated until } Repeated for
| Note text } end of note } all notes
| } } until end of
| } last note
| . End of note }
| .Note n Label for nth note }
|
An 'end of note' line is not needed for the last note.
You don't have to include page-break markers. Without them, the
'Builder' program will break the text anyway after every 30 lines.
But they are worth including. As long as they are within 30 lines of
each other, they allow you to control where the breaks will come.
"Head"
"Header"
Preparation 4
"PageNumber"
call HyperBookToBack()
10/31
"Hook"
"Preparation 4"
"Hyperbook2"
"HBReader2"
"Master12"
Note1
Once you have prepared your text, you start the compilation by giving
the command 'rx Builder' or by clicking on the Builder icon
(assuming the icon's default tool setting is 'rx').
If Master1 is not present, the program will not work.
The program uses HBReader if it is available. If it is not, then
Hyperbook will be used. If neither is available, the program will
not work.
A file selector appears. Click on the name of the file you wish to
process. Then all you have to do is watch (if you want to).
DO NOTHING MORE
until a message box appears, telling you that the
compilation is complete, and asking if you want to run the new
version immediately.
What you will see, if you watch the process, is described on the
next two screens.
"Head"
"Header"
Compilation 1
"Master1"
"HBReader"
"Hyperbook"
"PageNumber"
call HyperBookToBack()
11/31
"Compilation 1"
"Small"
"frames2"
Note1
Sweep One - forwards
For each screenload, only the text appears on the screen during the
first sweep through.
The following are dealt with page by page during this process, but are
not displayed at this stage :
- Highlighting of chunks of text.
- Placement of page titles in the top left corner, plus numbers to
indicate their position in each segment :
ThisNote 1, ThisNote 2, and so on.
- Any frames which have been included.
If you want more of the activity to be displayed during compilation,
remove some of the 'Interactive(0)' settings in the program. I have't
checked, but I don't think this would involve any noticeable increase
in processing time.
"Head"
"Header"
Compilation 2
"frames"
"PageNumber"
call HyperBookToBack()
12/31
"Compilation 2"
"Small"
Note1
Sweep Two - back to the start
A reverse sweep through all pages then takes place to deal with the
upper-right page-number entries, and to place a prompting arrow on
pages which are the last (or only) one in their section.
This is much quicker than the first sweep, and everything is visible at
this stage. A few seconds after this is finished, when you have been
taken back on page 1, a 'Processing complete' message appears.
Until it does, just WAIT.
If you accept the offer of an immediate view of the processed result,
wait a second or so for the newly stored copy to be loaded in - a
momentary screen darkening and/or a flickering in the pointer gadget
will be the signs - and then try it out.
"Head"
"Header"
Compilation 3
"PageNumber"
call HyperBookToBack()
13/31
"Hook"
"Compilation 3"
Note1
If your output document is called, say, 'Document.ht', then
either
HBReader Document.ht OR Hyperbook Document.ht
will be enough to run it.
The usual alternative of clickable icons in a WorkBench window will
of course work if appropriate default tool settings are installed via
'Information'.
If you use the 'Update' menu item, you should find that a Hyperbook
icon for new your document has been produced. That new icon should
have appeared
on top of
the Master1 icon, since a copy of that one was
used to obtain the new icon. You'll want to slide it into its own
position.
"Head"
"Header"
Running 1
"PageNumber"
call HyperBookToBack()
14/31
"Hook"
"Running 1"
"Builder2"
"HBReader2"
"Hyperbook2"
Note1
You will have seen how various plain or coloured frames have been
added to this set of pages to shape the output and generally add
interest. These frames can be inserted in two ways, both of which
work with either Hyperbook or HBReader :
1 Before the document file is converted by Builder, by
making appropriate insertions in the file.
2 After Builder has been used, by using a built-in macro.
"Head"
"Header"
Frames 1
"Hyperbook"
"HBReader"
"Builder"
"PageNumber"
call HyperBookToBack()
15/31
"Frames 1"
"Small"
Note1
Method 1 Inserting frames by making entries in the file
A line beginning with .Bx (for 'Box') is a frame specification.
This line -> .Bx 200,20,400,80
will produce a frame with upper left corner at x = 200, y = 20 and
lower right corner at x = 400, y = 80. The following settings apply :
background colour 0, border colour 1, shadow colour 2, shadow style
embossed.
This line -> .Bx 200,20,400,80,4
will produce the same, but with a background in colour 4.
If you have Hyperbook, you could experiment with adding extra
arguments to vary the border and shadow colours.
Note how '.Bx' expects 4 or 5 arguments, and how references to it on
this page did not actually (try to) work because the full stops of
the .Bx entries were not first in their respective lines.
"Head"
"Header"
Frames 2
"PageNumber"
call HyperBookToBack()
16/31
"Frames 2"
"Small"
"Builder2"
Note1
Method 2 Adding frames interactively after Builder has been used
The box which appears in the top left corner of every page to tell you
which section you are in, and how far into it you are, is also an
active gadget. If you click on it it will prompt you to click at the
upper left and bottom right corners of an intended frame. The frame
appears, BEHIND any text which it happens to enclose.
If, for any reason, you were to run Builder again, all such entries
would be lost, for which there is a solution on the next screen ...
"Head"
"Header"
Frames 3
"Builder"
"PageNumber"
call HyperBookToBack()
17/31
"Frames 3"
"Builder2"
Note1
Method 2 has the advantage of saving you the problem of working out
(guessing) the x and y values for the two corners, and the disadvantage
of losing your entries if, for any reason, you rerun Builder.
But after you have used Method 2, have a look in 'Ram:'. There you
will find a find called 'specs', and it will contain entries which look
like this :
| SectionName n (n = page number within section)
| .Bx 110,42,318,68
| AnotherSection n
| .Bx 20,22,500,34
That is, a reminder of which page within which section the frame was
designed for, and a set of specifications. It is no great task
to copy such entries from the file 'Ram:specs' into your original
document, putting them somewhere in the patch of text which produces
the page in question. You can add a background colour argument
at that point if you wish. (All kinds of enhancements are possible in
this area, if you feel adventurous.)
The entries are then safe, even if you run Builder again, and they can
easily be adjusted if you have second thoughts about the position and
size of any of the frames.
"Head"
"Header"
Frames 4
"Builder"
"PageNumber"
call HyperBookToBack()
18/31
"Frames 4"
"Small"
"Small"
"Small"
"Small"
Note1
You may be beginning to see that in fact TWO complete runs with
Builder are a good idea. A development sequence might then be :
1 First run of Builder to get all the texts, clickable chunks, and
page numbering set up.
2 Use the frame-making macro to add your decorations.
If you have Hyperbook you can, of course, add anything else you fancy
such as drawings and pictures, and/or make any other changes, like
changing the colour or style of text.
3 In a text editor, pull the .Bx entries which have been stored in
'Ram:temp' into your document file.
4 Second run of Builder to include the frames.
Very useful in the latter stages is the upper-right corner gadget for
pushing the entire Hyperbook screen to the back, allowing you to
have easy access to a text editor running in the background.
"Head"
"Header"
Frames 5
"PageNumber"
call HyperBookToBack()
19/31
"Hook"
"Frames 5"
"HBReader2"
"Hyperbook2"
"Builder2"
Note1
Three small macros are contained in the hypertext documents you
produce from Builder. If you have Hyperbook you will be able to
see, edit, and improve them.
With HBReader you can only use them.
When you click on a highlighted chunk of text, this macro reads the
text contained within the chunk, and then goes to the page of which
that chunk is the title.
When you click on a chunk of text, it changes its appearance, so that
you can always see which of the links you have already used. If you
want to unset them all to an 'unused' appearance, click on the 'Z'
gadget which appears only on page 1. The 'Zero' macro does the work.
Wait until the 'Z' gadget switches back to its original colour, to show
it has finished, before doing anything else.
FrameSpec
Prompts you to click twice to position a new frame, then creates
the frame, and stores its details in 'Ram:specs'.
"Head"
"Header"
Macros 1
"Builder"
"Hyperbook"
"HBReader"
"PageNumber"
call HyperBookToBack()
20/31
"Hook"
"Macros 1"
"Small"
Note1
What can one say?
ARexx is a super, clear, very powerful, and easy-to-use
computing language for quick day-to-day jobs.
ARexx is the language supplied by Commodore as an integral
part of Amiga Release 2.
I have done more with ARexx than with any other computing language,
and, believe me, I have tried quite a few.
I use ARexx every day, and have no intention of using anything
else (though I must confess to having said that about other
languages in the past).
"Head"
"Header"
ARexx 1
"PageNumber"
call HyperBookToBack()
21/31
"Hook"
"ARexx 1"
Note1
A system for browsing through documentation by
clicking on highlighted words or phrases, and
much, much more.
Whole books have been written about it ...
(mainly in connection with H*p*rC*rd on the M*c)
"Head"
"Header"
hypertext 1
"PageNumber"
call HyperBookToBack()
22/31
"Hook"
"hypertext 1"
"Small"
"MegaDisc2"
"hypertext2"
Note1
An Amiga implementation of hypertext. It has always been the subject
of veiled hints and shrouded in mystery, even being referred to, for
some obscure reason, as 'Am*g*G**d*' (or something like that). To my
knowledge, no formal, thorough guide, suitable for the uninitiated, has
been published.
An Apology
To you guys who have already made MegaDisc contributions on the
subject of AmigaGuide, I'm sorry, but you have over-estimated the
intelligence, reading skills, common sense, and patience of this
particular reader.
I have tried really hard, but I simply have not been able to get
AmigaGuide working in the way you describe.
"Head"
"Header"
AmigaGuide 1
"hypertext"
"MegaDisc"
"PageNumber"
call HyperBookToBack()
23/31
"Hook"
"AmigaGuide 1"
Note1
Note2
M E G A D I S C
The greatest!
The best!
Everybody's favourite!
Indispensable!
You need it!
Buy it!
Address :
P.O.Box 759,
Crows Nest 2065
Australia
"Head"
"Header"
MegaDisc 1
"PageNumber"
call HyperBookToBack()
24/31
"Hook"
Drawing3
Drawing4
"MegaDisc 1"
Note1
"Hyperbook is a general-purpose multi-media
tool that lets you store and organize text
and graphics in any format."
User's Guide, p.1
1990 Gold Disk Inc.
Hyperbook was designed and written by
AHA! Software
Nick Sullivan and Chris Zamara
Victoria, British Columbia, Canada
and is distributed by Gold Disk Inc.,
P.O.Box 789, Streetsville,
Mississauga, Ontario,
Canada L5M 2C2
I rate it 10 out of 10.
"Head"
"Header"
Hyperbook 1
"PageNumber"
call HyperBookToBack()
25/31
"Hook"
Drawing3
"Hyperbook 1"
"Builder2"
Note1
A freely distributable form of Hyperbook. You can use it to run
Hyperbook units, but it does not (normally) allow the creation or
editing of objects.
In writing the Builder project, I have tried to make the whole thing
usable through HBReader alone.
Attempting to producing a version for which HBReader would be adequate
was the hardest part of the whole exercise. For more details about
those problems, see my comments in 'Builder', or go to the next page.
Use the 'Return' gadget or key now if you'd rather not know.
"Head"
"Header"
HBReader 1
"Builder"
"PageNumber"
call HyperBookToBack()
26/31
"HBReader 1"
Note1
If you are using HBReader (as opposed to Hyperbook), you cannot, even
by means of a specifically written macro, create a new 'Note' which is
smaller than 62 x 24 or a new 'Button' smaller than 34 x 18. You can,
however, create a new 'Drawing' of any size.
I invite you to mull over the implications of these restrictions.
They had somehow to be circumvented when it came to :
Designing the highlighting which shows which chunks of text are
clickable, and the method used to indicate those chunks which
have already been clicked.
2
Allowing users to add frames interactively.
This is not easy to explain briefly, and it took some time to sort out,
but then I suppose the challenge is a part of the pleasure. A curious
compromise was reached in the end. If a frame being added is larger
than 62 x 24, an empty 'Note' is used for the frame, because 'Note'
background colour changing works well. For a smaller frame, a
'Drawing' is copied from a stored template, but its background colour
cannot be set by a fifth argument, because changing background colours
of drawings does not always work well.
"Head"
"Header"
HBReader 2
"PageNumber"
call HyperBookToBack()
27/31
"Hook"
"HBReader 2"
"Builder2"
"Hyperbook2"
Note1
Step
1 Master1 is a single-page template of a Hyperbook page.
One of the first steps in Builder is to make a copy of 'Master1'
(called Master2), so that your original of Master1 remains untouched.
2 Master2 becomes page 1 of your output hypertext document. Some of
the templates which it holds (being a copy of Master1) are removed.
Your page 1 contents are inserted into it, and then your further pages
are appended to it during the preparation process.
3 Finally, the complete Master2 is renamed as 'Document.ht'
(or whatever you called your input file, plus '.ht').
The contents of Master1, some of them not even visible, are
crucial to the process.
You are advised NOT to change it.
"Head"
"Header"
Master1 1
"Hyperbook"
"Builder"
"PageNumber"
call HyperBookToBack()
28/31
"Hook"
"Master1 1"
"Frames2"
"ARexx2"
Note1
'Builder' is the ARexx program which takes your plain text
and converts it into a series of hypertext pages, with clickable
chunks marked and ready for you to use. If you're interested in such
details, the 'Builder' file contains quite a few explanatory comments
Normally 'Builder' needs to be used only once for any correctly
prepared text, and so the fact that it takes some time to do the
conversion need not be a real concern. You can watch it do its
stuff, or find something else to do for a minute or two.
Elsewhere in this document is described a situation in which you may
well want to take Builder through a second run, but we won't go into
that now.
Though on second thoughts, why not. It is precisely that sort of
side-tracking that hypertext makes easy. Have a quick look at
Frames now if you want to.
"Head"
"Header"
Builder 1
"ARexx"
"Frames"
"PageNumber"
call HyperBookToBack()
29/31
"Builder 1"
"Small"
"ARexx2"
"Hyperbook2"
Note1
What runs what?
For owner/users of Hyperbook, it is regular practice to have a
Hyperbook unit which contains and uses ARexx macros.
In that situation, Hyperbook runs ARexx.
But the arrangement with 'Builder' is that an ARexx program first runs
Hyperbook, and then the more usual setup, as described in the preceding
paragraph, comes into play.
This arrangement means that Builder itself remains OUTSIDE any
Hyperbook unit produced, and so does not add its own size to what it
produces. It also means that all calls made by Builder to HML
functions must be preceded by 'HML_'. All of which is getting
a bit complicated. For more on this topic, see p.117 of the
Hyperbook manual. For lots of examples, see the code of 'Builder'.
"Head"
"Header"
Builder 2
"Hyperbook"
"ARexx"
"PageNumber"
call HyperBookToBack()
30/31
"Hook"
"Builder 2"
Note1
I have set my own colour preferences at about line 36 in the
code of the 'Builder' program.
If you want to change them, just edit the Builder file as required.
"Head"
"Header"
Colours 1
"PageNumber"
call HyperBookToBack()
31/31
"Hook"
Note3
Note4
Note5
Note6
Note7
Note8
Note9
Note10
"Colours 1"
execute start-qed
Note1
"Small"
"Large"
"Drawing1"
"Drawing2"
"Head"
"Header"
"Hook"